import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

//  hidden:是否在左侧菜单显示,默认:false
const routes = [
    {
        path: '/',
        name: '当前位置',
        component: () => import('_v/layout'),
        redirect: '/index',
        children: [
            {
                path: 'index',
                name: '首页',
                component: () => import('_v/'),

            },
            {
                path: '/list/:id',
                name: '列表',
                component: () => import('_v/list'),
            },
            {
                path: '/list2/:keyword',
                name: '列表',
                component: () => import('_v/list'),
            },
            {
                path: '/detail/:id',
                name: 'detail',
                component: () => import('_v/detail'),
            },
            // {path: '/404', component: () => import('@/pages/layout/404')}
        ]
    },
    {
        path: '/sys',
        name: '后台管理',
        component: () => import('_v/sysLayout'),
        redirect: '/sys/index',
        children: [
            {
                path: 'index',
                name: '首页',
                icon: 'el-icon-star-off',
                component: () => import('_v/sys/'),
            },
            {
                path: 'article',
                name: '文章管理',
                icon: 'el-icon-star-off',
                component: () => import('_v/sys/article/index'),

            },
            {
                path: 'newType',
                name: '文章管类型管理',
                icon: 'el-icon-ship',
                component: () => import('_v/sys/newsType'),
            },
            {
                path: 'user',
                name: '用户管理',
                icon: 'el-icon-s-custom',
                component: () => import('_v/sys/user'),
            },

        ]
    },
    {path: '/404', component: () => import('@/pages/layout/404')},

    // {path: '/401', component: () => import('@/pages/layout/401')},
    // {path: '/500', component: () => import('@/pages/layout/500')},
    {
        path: '*',
        component: () => import('_v/layout'),
        redirect: '/404',
        children: [
            {path: '/404', component: () => import('@/pages/layout/404')}
        ]
    }

]
export {
    routes
}
export default new Router({
    // mode: 'history',
    mode: 'hash',
    routes: routes
})